package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TalPolicyMapper;
import com.ruoyi.system.domain.TalPolicy;
import com.ruoyi.system.service.ITalPolicyService;

/**
 * 人才政策Service业务层处理
 *
 * @author zhusq
 * @date 2023-03-27
 */
@Service
public class TalPolicyServiceImpl extends ServiceImpl<TalPolicyMapper ,TalPolicy> implements ITalPolicyService
{
    @Autowired
    private TalPolicyMapper talPolicyMapper;

    /**
     * 查询人才政策
     *
     * @param id 人才政策主键
     * @return 人才政策
     */
    @Override
    public TalPolicy selectTalPolicyById(Long id)
    {
        return talPolicyMapper.selectTalPolicyById(id);
    }

    /**
     * 查询人才政策列表
     *
     * @param talPolicy 人才政策
     * @return 人才政策
     */
    @Override
    public List<TalPolicy> selectTalPolicyList(TalPolicy talPolicy)
    {
        return talPolicyMapper.selectTalPolicyList(talPolicy);
    }

    /**
     * 新增人才政策
     *
     * @param talPolicy 人才政策
     * @return 结果
     */
    @Override
    public int insertTalPolicy(TalPolicy talPolicy)
    {
        talPolicy.setCreateTime(DateUtils.getNowDate());
        return talPolicyMapper.insertTalPolicy(talPolicy);
    }

    /**
     * 修改人才政策
     *
     * @param talPolicy 人才政策
     * @return 结果
     */
    @Override
    public int updateTalPolicy(TalPolicy talPolicy)
    {
        talPolicy.setUpdateTime(DateUtils.getNowDate());
        return talPolicyMapper.updateTalPolicy(talPolicy);
    }

    /**
     * 批量删除人才政策
     *
     * @param ids 需要删除的人才政策主键
     * @return 结果
     */
    @Override
    public int deleteTalPolicyByIds(Long[] ids)
    {
        return talPolicyMapper.deleteTalPolicyByIds(ids);
    }

    /**
     * 删除人才政策信息
     *
     * @param id 人才政策主键
     * @return 结果
     */
    @Override
    public int deleteTalPolicyById(Long id)
    {
        return talPolicyMapper.deleteTalPolicyById(id);
    }
}
